import { createRouter, createWebHistory } from 'vue-router';
import Login from '@/views/login/index.vue';
import Forget from '@/views/forget/index.vue';
import Layout from '@/views/layout/index.vue';
import Home from '@/views/home/index.vue';
import OverloadManage from '@/views/overload/index.vue';
import OverloadManageDetail from '@/views/overload/detail/index.vue';
import DriverManage from '@/views/driver/index.vue';
import UserManage from '@/views/user/index.vue';
import SweepManage from '@/views/sweep/index.vue';
import BoxManage from '@/views/box/index.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      component: Login,
    },
    {
      path: '/forget',
      name: 'forget',
      component: Forget,
    },
    {
      path: '/',
      name: 'home',
      redirect: "/home",
      component: Layout,
      children: [
        {
          path: '/home',
          name: 'home',
          component: Home,
        },
        {
          path: '/overload',
          name: 'good',
          component: OverloadManage,
        },
        {
          path: '/overloadDetail',
          name: 'good2',
          component: OverloadManageDetail
        },
        {
          path: '/driver',
          name: 'order',
          component: DriverManage
        },
        {
          path: '/user',
          name: 'user',
          component: UserManage
        },
        {
          path: '/sweep',
          name: 'sweep',
          component: SweepManage
        },
        {
          path: '/box',
          name: 'box',
          component: BoxManage
        }
      ]
    },
    
  ]
});

export default router;
